<template>
  <div>
    <div class="wp">
      <div class="modal">
        <div class="modal-header">
          <slot name="header">默认标题</slot>
        </div>
        <div class="modal-body">
          <slot name="body">默认内容</slot>
        </div>
        <div class="modal-footer">
          <slot name="footer">默认底部信息</slot>
        </div>
        <button @click="$emit('close')">OK</button>
      </div>
    </div>
  </div>
</template>

<script>
export default {};
</script>

<style scoped>
* {
  margin: 0;
  padding: 0;
}
.wp {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
}
.modal {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  width: 20%;
  height: 20%;
  padding: 20px 40px;
}
button {
  position: absolute;
  bottom: 15%;
  right: 15%;
  width: 50px;
  height: 30px;
}
.modal-header,
.modal-body,
.modal-footer{
  margin: 10px 0;
}
</style>
